<!DOCTYPE html>
<!--
 *  创建时间: 2021-02-03-8:49
 *  作   者: lpc
 *  Email : lpc@hll520.cn
-->
<html lang="zh" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>添加数据</title>
    <!-- Bootstrap JQ核心CSS 、JS-->
    <script src="/static/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
    <link href="/static/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/static/linling-core-tools/js/linling-core-tools.js" type="text/javascript"></script>
    <!-- 适用于Surface /台式机Windows 8错误的IE10视口黑客 -->
    <script src="/static/linling-core-tools/js/ie10-viewport-bug-workaround.js"
            type="text/javascript"></script>
    <link href="/static/linling-core-tools/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <script>
        let i = 0;

        function time() {
            $("#info").html(`
                    <h1 class="page-header">正在采集/刷新ing...<br/>已用时
                    <span style="color: #4cae4c;" id="time">0
                    </span>秒,请稍后....
                    </h1>
            `);
            setInterval(function () {
                i += 0.1;
                $("#time").html(i);
            }, 100);
        }

        function collection(src) {
            if (src === 1) {
                time();
                location.href = "/collection/bilibili/all";
            }
        }

        function collectionSingle(src) {
            if (src === 1) {
                let id = prompt("请输入动态ID\n动态页面地址https://t.bilibili.com/XXX?中的XXX(注意不包括问好)");
                location.href = "/collection/bilibili/single?mid=" + id;
            }
        }

        function renew(src) {
            if (src === 1) {
                time();
                location.href = "/collection/bilibili/update";
            }
        }
    </script>
</head>
<body>
<div class="container">
    <div class="col-sm-10" id="info">
    </div>
    <div class="col-sm-10">
        <h1 class="page-header">数据采集</h1>
        <p>自动采集以下来源的数据</p>
        <p></p>
        <input type="submit" class="btn btn-lg btn-info btn-block" style="margin-top: 10px"
               value="哔哩哔哩(单条)" onclick="collectionSingle(1)">
        <input type="submit" class="btn btn-lg btn-info btn-block" style="margin-top: 10px"
               value="哔哩哔哩(全部)" onclick="collection(1)">
    </div>

    <div class="col-sm-10">
        <h1 class="page-header">刷新数据</h1>
        <p>自动刷新以下来源的动态数据（阅读\点赞\转发)</p>
        <p></p>
        <input type="submit" class="btn btn-lg btn-primary btn-block" style="margin-top: 10px"
               value="哔哩哔哩" onclick="renew(1)">
    </div>

</div>


</body>
</html>